import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      meta: { keepAlive: true },
      name: 'workbench',
      component: resolve => {
        require.ensure(['../views/Workbench'], () => {
          resolve(require('../views/Workbench'))
        })
      }
    },
    {
      path: '/prediction',
      name: 'prediction',
      component: resolve => {
        require.ensure(['../views/Prediction'], () => {
          resolve(require('../views/Prediction'))
        })
      }
    },
    {
      path: '/team-profile',
      name: 'team-profile',
      component: resolve => {
        require.ensure(['../views/TeamProfile'], () => {
          resolve(require('../views/TeamProfile'))
        })
      }
    },
    {
      path: '/prediction',
      name: 'prediction',
      component: resolve => {
        require.ensure(['../views/Prediction'], () => {
          resolve(require('../views/Prediction'))
        })
      }
    },
    {
      path: '/member-profile',
      name: 'member-profile',
      component: resolve => {
        require.ensure(['../views/MemberProfile'], () => {
          resolve(require('../views/MemberProfile'))
        })
      }
    },
    {
      path: '/team-ranking',
      name: 'team-ranking',
      component: resolve => {
        require.ensure(['../views/TeamRanking'], () => {
          resolve(require('../views/TeamRanking'))
        })
      }
    },
    {
      path: '/member-ranking',
      name: 'member-ranking',
      component: resolve => {
        require.ensure(['../views/MemberRanking'], () => {
          resolve(require('../views/MemberRanking'))
        })
      }
    },
    {
      path: '/new-custom',
      name: 'new-custom',
      component: resolve => {
        require.ensure(['../views/NewCustom'], () => {
          resolve(require('../views/NewCustom'))
        })
      }
    },
    {
      path: '/new-sign',
      name: 'new-sign',
      component: resolve => {
        require.ensure(['../views/NewSign'], () => {
          resolve(require('../views/NewSign'))
        })
      }
    },
    {
      path: '/new-transaction',
      name: 'new-transaction',
      component: resolve => {
        require.ensure(['../views/NewTransaction'], () => {
          resolve(require('../views/NewTransaction'))
        })
      }
    },

    {
      path: '/performance-setting',
      name: 'performance-setting',
      component: resolve => {
        require.ensure(['../views/PerformanceSetting'], () => {
          resolve(require('../views/PerformanceSetting'))
        })
      }
    },
    {
      path: '/default-address',
      name: 'default-address',
      component: resolve => {
        require.ensure(['../views/DefaultAddress'], () => {
          resolve(require('../views/DefaultAddress'))
        })
      }
    },
    // 销售业绩
    {
      path: '/performance',
      name: 'performance',
      component: resolve => {
        require.ensure(['../views/Performance'], () => {
          resolve(require('../views/Performance'))
        })
      }
    },

    {
      path: '/marketing',
      component: resolve => {
        require.ensure(['../views/Marketing'], () => {
          resolve(require('../views/Marketing'))
        })
      }
    },

    {
      name: 'h5marketing',
      path: '/h5marketing',
      component: resolve => {
        require.ensure(['../views/H5Marketing'], () => {
          resolve(require('../views/H5Marketing'))
        })
      }
    },

    {
      path: '/mine',
      component: resolve => {
        require.ensure(['../views/Mine'], () => {
          resolve(require('../views/Mine'))
        })
      }
    },
    {
      name: 'social-client',
      path: '/social-client',
      meta: { keepAlive: true },
      component: resolve => {
        require.ensure(['../views/SocialClients'], () => {
          resolve(require('../views/SocialClients'))
        })
      }
    },
    {
      name: 'new-roll',
      path: '/new-roll',
      meta: { keepAlive: true },
      component: resolve => {
        require.ensure(['../views/NewRoll'], () => {
          resolve(require('../views/NewRoll'))
        })
      }
    },
    {
      name: 'cha-chong',
      path: '/cha-chong',
      component: resolve => {
        require.ensure(['../views/ChaChong'], () => {
          resolve(require('../views/ChaChong'))
        })
      }
    },
    {
      name: 'normal-client',
      path: '/normal-client',
      meta: { keepAlive: true },
      component: resolve => {
        require.ensure(['../views/NormalClients'], () => {
          resolve(require('../views/NormalClients'))
        })
      }
    },

    {
      name: 'img-view',
      path: '/img-view',
      // component: ImageView
      component: resolve => {
        require.ensure(['../views/ImageView'], () => {
          resolve(require('../views/ImageView'))
        })
      }
    },

    // {
    //   name: 'client-detail',
    //   path: '/client-detail',
    //   component: ClientDetail
    // },

    {
      path: '/client-info',
      component: resolve => {
        require.ensure(['../views/ClientInfo'], () => {
          resolve(require('../views/ClientInfo'))
        })
      }
    },

    {
      name: 'follow-record',
      path: '/follow-record',
      // meta: {homeButton: true},
      component: resolve => {
        require.ensure(['../views/FollowRecord'], () => {
          resolve(require('../views/FollowRecord'))
        })
      }
    },

    {
      name: 'select-follow',
      path: '/select-follow',
      component: resolve => {
        require.ensure(['../views/SelectFollow'], () => {
          resolve(require('../views/SelectFollow'))
        })
      }
    },

    {
      meta: { keepAlive: true },
      name: 'reassign-client',
      path: '/reassign-client',
      component: resolve => {
        require.ensure(['../views/ReassignClient'], () => {
          resolve(require('../views/ReassignClient'))
        })
      }
    },
    {
      meta: { keepAlive: true },
      name: 'normal-reassign-client',
      path: '/normal-reassign-client',
      component: resolve => {
        require.ensure(['../views/NormalReassignClient'], () => {
          resolve(require('../views/NormalReassignClient'))
        })
      }
    },

    {
      meta: { keepAlive: true },
      name: 'client-seas',
      path: '/client-seas',
      component: () => import('../views/ClientSeas.vue')
    },
    {
      meta: { keepAlive: true },
      name: 'intel-client-seas',
      path: '/intel-client-seas',
      component: () => import('../views/IntelClientSeas.vue')
    },
    // {
    //   meta: { keepAlive: true },
    //   name: 'client-seas',
    //   path: '/client-seas',
    //   component: resolve => {
    //     require.ensure(['../views/ClientSeas'], () => {
    //       resolve(require('../views/ClientSeas'))
    //     })
    //   }
    // },
    // {
    //   meta: { keepAlive: true },
    //   name: 'normal-client-seas',
    //   path: '/normal-client-seas',
    //   component: resolve => {
    //     require.ensure(['../views/NormalClientSeas'], () => {
    //       resolve(require('../views/NormalClientSeas'))
    //     })
    //   }
    // },
    {
      meta: { keepAlive: true },
      name: 'normal-client-seas',
      path: '/normal-client-seas',
      component: () => import('../views/NormalClientSeas.vue')
    },

    // {
    //   path: '/normal-clients',
    //   component: NormalClients
    // },

    {
      name: 'normal-clients-detail',
      path: '/normal-clients-detail',
      meta: {homeButton: true},
      component: resolve => {
        require.ensure(['../views/NormalClientDetail'], () => {
          resolve(require('../views/NormalClientDetail'))
        })
      }
    },

    {
      name: 'client-detail',
      path: '/client-detail',
      meta: {homeButton: true},
      component: resolve => {
        require.ensure(['../views/ClientDetail'], () => {
          resolve(require('../views/ClientDetail'))
        })
      }
    },

    {
      name: 'add-normal-client',
      path: '/add-normal-client',
      meta: {homeButton: true},
      component: resolve => {
        require.ensure(['../views/AddNormalClient'], () => {
          resolve(require('../views/AddNormalClient'))
        })
      }
    },

    {
      name: 'edit-normal-client',
      path: '/edit-normal-client',
      meta: {homeButton: true},
      component: resolve => {
        require.ensure(['../views/EditNormalClient'], () => {
          resolve(require('../views/EditNormalClient'))
        })
      }
    },

    {
      name: 'order-audition',
      path: '/order-audition',
      component: resolve => {
        require.ensure(['../views/OrderAudition'], () => {
          resolve(require('../views/OrderAudition'))
        })
      }
    },

    {
      path: '/my-card',
      component: resolve => {
        require.ensure(['../views/MyCard'], () => {
          resolve(require('../views/MyCard'))
        })
      }
    },

    {
      path: '/team-setting',
      component: resolve => {
        require.ensure(['../views/TeamSetting'], () => {
          resolve(require('../views/TeamSetting'))
        })
      }
    },

    {
      name: 'add-team',
      path: '/add-team',
      component: resolve => {
        require.ensure(['../views/AddTeam'], () => {
          resolve(require('../views/AddTeam'))
        })
      }
    },

    {
      name: 'edit-team',
      path: '/edit-team',
      component: resolve => {
        require.ensure(['../views/EditTeam'], () => {
          resolve(require('../views/EditTeam'))
        })
      }
    },

    {
      name: 'h5-marketing',
      path: '/h5-marketing',
      component: resolve => {
        require.ensure(['../views/H5MarketingPage'], () => {
          resolve(require('../views/H5MarketingPage'))
        })
      }
    },

    {
      name: 'add-follow',
      path: '/add-follow',
      component: resolve => {
        require.ensure(['../views/AddFollow'], () => {
          resolve(require('../views/AddFollow'))
        })
      }
    },
    {
      path: '/scan-code',
      name: 'scan-code',
      component: resolve => {
        require.ensure(['../views/ScanCode'], () => {
          resolve(require('../views/ScanCode'))
        })
      }
    },
    {
      path: '/invite-code',
      name: 'invite-code',
      component: resolve => {
        require.ensure(['../views/InviteCode'], () => {
          resolve(require('../views/InviteCode'))
        })
      }
    },
    {
      path: '/scan-code-config',
      name: 'scan-code-config',
      component: resolve => {
        require.ensure(['../views/ScanCodeConfig'], () => {
          resolve(require('../views/ScanCodeConfig'))
        })
      }
    },
    {
      path: '/bind-poster',
      name: 'bind-poster',
      component: resolve => {
        require.ensure(['../views/BindPoster'], () => {
          resolve(require('../views/BindPoster'))
        })
      }
    },
    {
      path: '/code-verification',
      name: 'code-verification',
      component: resolve => {
        require.ensure(['../views/CodeVerification'], () => {
          resolve(require('../views/CodeVerification'))
        })
      }
    },
    {
      path: '/scan-code-detail',
      name: 'scan-code-detail',
      component: resolve => {
        require.ensure(['../views/ScanCodeDetail'], () => {
          resolve(require('../views/ScanCodeDetail'))
        })
      }
    },

    {
      path: '/subscribe-clients',
      name: 'subscribe-clients',
      component: resolve => {
        require.ensure(['../views/SubscribeClients'], () => {
          resolve(require('../views/SubscribeClients'))
        })
      }
    },

    {
      path: '/audtion',
      name: 'audtion',
      component: resolve => {
        require.ensure(['../views/OrderAuditionDetail'], () => {
          resolve(require('../views/OrderAuditionDetail'))
        })
      }
    },

    {
      path: '/stick-tag',
      name: 'stick-tag',
      component: resolve => {
        require.ensure(['../views/StickTag'], () => {
          resolve(require('../views/StickTag'))
        })
      }
    },

    {
      path: '/member-setting',
      name: 'member-setting',
      component: resolve => {
        require.ensure(['../views/MemberSetting'], () => {
          resolve(require('../views/MemberSetting'))
        })
      }
    },
    {
      path: '/member-manage',
      name: 'member-manage',
      component: resolve => {
        require.ensure(['../views/MemberManage'], () => {
          resolve(require('../views/MemberManage'))
        })
      }
    },
    { // 客户分配设置
      path: '/reassign-setting',
      name: 'reassign-setting',
      component: resolve => {
        require.ensure(['../views/ReassignSetting'], () => {
          resolve(require('../views/ReassignSetting'))
        })
      }
    },
    { // 客户释放设置
      path: '/release-setting',
      name: 'release-setting',
      component: resolve => {
        require.ensure(['../views/ReleaseSetting'], () => {
          resolve(require('../views/ReleaseSetting'))
        })
      }
    },
    { // 抢单
      path: '/reassign-list',
      name: 'reassign-list',
      component: resolve => {
        require.ensure(['../views/ReassignList'], () => {
          resolve(require('../views/ReassignList'))
        })
      }
    },
    { // 设置成员最大限制
      path: '/max-limit',
      name: 'max-limit',
      component: resolve => {
        require.ensure(['../views/MaxLimit'], () => {
          resolve(require('../views/MaxLimit'))
        })
      }
    },
    { // 无跟进释放设置
      path: '/no-follow-config',
      name: 'no-follow-config',
      component: resolve => {
        require.ensure(['../views/NoFollowConfig'], () => {
          resolve(require('../views/NoFollowConfig'))
        })
      }
    },
    { // 无成交释放设置
      path: '/no-deal-config',
      name: 'no-deal-config',
      component: resolve => {
        require.ensure(['../views/NoDealConfig'], () => {
          resolve(require('../views/NoDealConfig'))
        })
      }
    },
    { // 客户再分配限制
      path: '/rs-rule-config',
      name: 'rs-rule-config',
      component: resolve => {
        require.ensure(['../views/ReassignRuleConfig'], () => {
          resolve(require('../views/ReassignRuleConfig'))
        })
      }
    },
    { // 学员订单
      path: '/lesson-order',
      name: 'lesson-order',
      component: resolve => {
        require.ensure(['../views/LessonOrder'], () => {
          resolve(require('../views/LessonOrder'))
        })
      }
    },
    { // 红包记录
      path: '/redpack-link',
      name: 'redpack-link',
      component: resolve => {
        require.ensure(['../views/RedpackRecord'], () => {
          resolve(require('../views/RedpackRecord'))
        })
      }
    },
    { // 提现
      path: '/tixian',
      name: 'tixian',
      component: resolve => {
        require.ensure(['../views/Tixian'], () => {
          resolve(require('../views/Tixian'))
        })
      }
    },
    { // 重新分配团队
      path: '/reassign-teams',
      name: 'reassign-teams',
      component: resolve => {
        require.ensure(['../views/ReassignTeams'], () => {
          resolve(require('../views/ReassignTeams'))
        })
      }
    },
    {
      // 消息列表
      path: '/msg-list',
      name: 'msg-list',
      component: resolve => {
        require.ensure(['../views/MsgList'], () => {
          resolve(require('../views/MsgList'))
        })
      }
    },
    {
      // 销售业绩更多
      path: '/sales-performance-more',
      name: 'sales-performance-more',
      component: resolve => {
        require.ensure(['../views/SalesPerformanceMore'], () => {
          resolve(require('../views/SalesPerformanceMore'))
        })
      }
    },
    {
      // 销售业绩更多
      path: '/funnel-model-more',
      name: 'funnel-model-more',
      component: resolve => {
        require.ensure(['../views/FunnelModelMore'], () => {
          resolve(require('../views/FunnelModelMore'))
        })
      }
    },
    {
      //
      path: '/is-valid-list',
      name: 'is-valid-list',
      component: resolve => {
        require.ensure(['../views/IsValidList'], () => {
          resolve(require('../views/IsValidList'))
        })
      }
    },
    {
      name: '',
      path: '/normal-client-cheng-jiao',
      meta: { keepAlive: true },
      component: resolve => {
        require.ensure(['../views/NormalClientsChengJiao'], () => {
          resolve(require('../views/NormalClientsChengJiao'))
        })
      }
    },
    {
      name: 'normal-reassign-client-cheng-jiao',
      path: '/normal-reassign-client-cheng-jiao',
      meta: { keepAlive: true },
      component: resolve => {
        require.ensure(['../views/NormalReassignClientChengJiao'], () => {
          resolve(require('../views/NormalReassignClientChengJiao'))
        })
      }
    },
    {
      name: 'marketer',
      path: '/marketer',
      component: resolve => {
        require.ensure(['../views/Marketer'], () => {
          resolve(require('../views/Marketer'))
        })
      }
    },
    {
      path: '/new-custom-analyze',
      name: 'new-custom-analyze',
      component: resolve => {
        require.ensure(['../views/NewCustomAnalyze'], () => {
          resolve(require('../views/NewCustomAnalyze'))
        })
      }
    },
    {
      path: '/new-custom-analyze-source',
      name: 'new-custom-analyze-source',
      component: resolve => {
        require.ensure(['../views/NewCustomAnalyzeSource'], () => {
          resolve(require('../views/NewCustomAnalyzeSource'))
        })
      }
    },
    {
      path: '/new-custom-guanhuai-analyze',
      name: 'new-custom-guanhuai-analyze',
      component: resolve => {
        require.ensure(['../views/NewCustomGuanHuaiAnalyze'], () => {
          resolve(require('../views/NewCustomGuanHuaiAnalyze'))
        })
      }
    },
    {
      path: '/new-custom-chengjiao-analyze',
      name: 'new-custom-chengjiao-analyze',
      component: resolve => {
        require.ensure(['../views/NewCustomChengJiaoAnalyze'], () => {
          resolve(require('../views/NewCustomChengJiaoAnalyze'))
        })
      }
    },
  ]
})
